package com.rika.service.impl;

import com.rika.dao.CategoryDao;
import com.rika.pojo.Category;
import com.rika.service.CategoryService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;
@Service
public class CategoryServiceImpl implements CategoryService {
    @Resource
    private CategoryDao categoryDao;

    @Override
    public List<Category> selectAllCategory(Map<String, Object> params) {
        return categoryDao.selectAllCategory(params);
    }

    @Override
    public Integer countAll() {
        return categoryDao.countAll();
    }

    @Override
    public void insertCategory(Category category) {
        categoryDao.insertCategory(category);
    }

    @Override
    public void deleteCategory(Integer categoryId) {
        categoryDao.deleteCategory(categoryId);
    }

    @Override
    public Category selectBycategoryID(Integer categoryId) {
        return categoryDao.selectBycategoryID(categoryId);
    }

    @Override
    public void updateCategory(Category category) {
        categoryDao.updateCategory(category);
    }

    @Override
    public List<Category> selectCategoryForProduct() {
        return categoryDao.selectCategoryForProduct();
    }
}
